home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util4 / 0utils.lha / 0Utils / Yes.data < prev    next >
Text File  |  1995-08-19  |  1KB  |  67 lines

  1.  
  2. #ifdef TPLTER
  3.  
  4. Yes = {
  5.  
  6.     version = "1.1";
  7.     short   = {{ Output 'y' lines }};
  8.  
  9.     description = {{
  10.     Output an nearly endless stream of 'y' lines
  11.     (actually 2^32-1).
  12.     The output string can bve changed w/ the
  13.     STRING parameter; please note, that for
  14.     that case, Yes does _not_ add newlines
  15.     itself, so the string must itself contain
  16.     a newline.
  17.     The number of output lines can be varied w/
  18.     the LINES parameter.
  19.  
  20.     RESULT
  21.     what can we call a result here?
  22.     }};
  23.  
  24.     examples = {{
  25.     >Yes LINES=5
  26.     y
  27.     y
  28.     y
  29.     y
  30.     y
  31.     }};
  32.  
  33.     history = {{
  34.     05-04-95 b_noll (1.0) created
  35.     12-04-95 b_noll source modification
  36.     19-08-95 b_noll created .data file
  37.     19-08-95 b_noll (1.1) removed '*n' neccessity, changed args precedence
  38.     }};
  39.  
  40.     template = "LINES/N,STRING,NONL/S";
  41.     args     = {{
  42.     ULONG *lines;
  43.     STRPTR string;
  44.     ULONG  noNL;
  45.     }};
  46.  
  47.     body = {{
  48.         {
  49.         STRPTR string;
  50.         ULONG  count;
  51.         retval = RETURN_OK;
  52.         string = argv->string ? argv->string : "y";
  53.         count = argv->lines ? *argv->lines : ~0;
  54.         while (!CheckSignal(SIGBREAKF_CTRL_C) && count--) {
  55.             if ((PutStr(string) || (!argv->noNL && PutStr("\n"))) != 0) {
  56.             retval = 10;
  57.             break;
  58.             } /* if */
  59.         } /* while */
  60.  
  61.         }
  62.     }};
  63. };
  64.  
  65. #endif
  66.  
  67.